package com.union.core.sys.service;

import java.util.List;

import org.apache.log4j.Logger;

import com.union.core.sys.dao.PublicSentAudiDao;
import com.union.core.sys.dao.impl.PublicSentAudiDaoImpl;
import com.union.core.sys.model.PublicSentAudi;

/**
 * 业务逻辑处理类:系统模块
 * filename: PublicSentAudiService.java
 * project:  CCTR
 * @company Hainan Jowe Technology Ltd
 * @author wull
 * @create in 2012-10-31
 * @version 1.0
 */
public class PublicSentAudiService{
	
	private static Logger log = Logger.getLogger(PublicSentAudiService.class.getName());
	private PublicSentAudiDao publicSentAudiDaoImpl;
	
	public PublicSentAudiService(){
		publicSentAudiDaoImpl = new PublicSentAudiDaoImpl();
	}
	
	
	public boolean addAudi(int publicSentId,PublicSentAudi PublicSentAudi){
    	PublicSentAudi.setStatus(1);
    	boolean flag = publicSentAudiDaoImpl.addAudi(publicSentId,PublicSentAudi);
    	log.info("添加评阅信息");
    	return flag;
	}
	
	
	public List<PublicSentAudi> getPubSentAudiList(int publicSentId,int status)
	{
		log.info("查看评阅信息");
		return publicSentAudiDaoImpl.getPubSentAudiList(publicSentId, status);
	}
	
	public boolean deleteAudi(int pubSentId){
		if(!publicSentAudiDaoImpl.deleteAudi(pubSentId))
		{
			log.info("删除舆情评阅失败!");
			return false;
		}
		else
		{
			log.info("删除舆情评阅成功!");
			return true;
		}
	}
	
}
